function tryCreateExecuter() {


//this is for the array object reference operations
ArrayObject = function(type,size) {
	this.type = type;
	this.size = size;
	this.array = [];
};

IEEE2long = function(num) { //convert a number from IEEE standard to long number in JS
	return num; //unfinished yet;
};

IEEE2double = function(longNum) { //IEEE standard to double, IEEE number is long
	if(longNum == 0x7ff0000000000000) {
		return Infinity;
	} else if(longNum == 0xfff0000000000000) {
		return -Infinity;
	} else if((longNum >= 0x7ff0000000000001 && longNum <= 0x7fffffffffffffff) ||
		(longNum >= 0xfff0000000000001 && longNum <= 0xffffffffffffffff)) {
		return NaN;
	}
	s = ((longNum >> 63) == 0) ? 1 : -1;
    	e = (int)((longNum >> 52) & 0x7ff);
    	m = (e == 0) ?
    		(longNum & 0xfffffffffffff) << 1 :
    		(longNum & 0xfffffffffffff) | 0x10000000000000;
	return s * m * Math.pow(2,e-1075);
};


//valueObject and their types
valueObject = function(inType,inValue) {
	this.type = inType;
	this.value = inValue;
};

//type:
BOOLEAN = 4;
CHAR = 5;
FLOAT = 6;
DOUBLE = 7;
BYTE = 8;
SHORT = 9;
INT = 10;
LONG = 11;
REFERENCE = 12;


//================================================
	/*

	1: UTF8
	3: Integer
	4: Float
	5: Long

	6: Double
	7: Class
	8: String

	9: Fieldref
	10: Methodref
	11: InterfaceMethodref

	12: NameAndType
	*/
	//alert(this.itpt);
	
	this.tryExecuteOpCode = function() {
		current_frame = the_itpt.stack[the_itpt.stack.length - 1];
		current_class = current_frame.the_class;
		current_parse_result = current_class.parse_result;
		if (current_frame.pc == current_frame.code.length) {//TODO: check the process
			the_itpt.stack.pop();
			return;
		}
		//alert(current_frame);
		this.operations[current_frame.code[current_frame.pc]](); //Do not put "()" here. I don't know why
		++current_frame.pc;
		/*

		var st = "";
		for (var i = 0; i < current_frame.operand_stack.length; ++i) st += current_frame.operand_stack[i] + "\t";

		alert(st);
		*/
	};
	
	function tryGetField(idx) {
		function tryResolveAndGetField(class_name, field_name) {
			if (class_name == "java/lang/System") {
				return new tryCreateOperand("class", new tryCreateClass(class_name + "." + field_name, null)); //Fake
			}
			var the_class = the_loader.tryLoadAndLink(class_name);
			the_class.tryInitializeClass();
			//TODO file:///C:/Users/dell/Desktop/System/vmspec/ConstantPool.doc.html#71685
			//...
		}
		if (idx < 1 || idx >= current_parse_result.constant_pool_count) throw "NoSuchFieldError";
		if (current_parse_result.constant_pool[idx].tag != 9) throw "NoSuchFieldError";
		
		var c_pool = current_parse_result.constant_pool;
		var class_name = c_pool[c_pool[c_pool[idx].class_index].name_index].actual_string;
		var field_name = c_pool[c_pool[c_pool[idx].name_and_type_index].name_index].actual_string;
		var type_name = c_pool[c_pool[c_pool[idx].name_and_type_index].descriptor_index].actual_string;
		
		return tryResolveAndGetField(class_name, field_name); //return Oprand Value
		
		//TODO access control? file:///C:/Users/dell/Desktop/System/vmspec/ConstantPool.doc.html#71685
		//TODO loading constraint?
	}
	
	function tryGetMethodFrame(idx) {
		function tryResolveAndGetMethodFrame(class_name, method_name) {
			function createFakeFrame(c_name, m_name) {
				this.class_name = c_name;
				this.method_name = m_name;
			}
			if (class_name == "java/io/PrintStream" && method_name == "println")
				return new createFakeFrame(class_name, method_name);
			if (debugMode == 1) alert("class_name: " + method_name + "; method_name: " + method_name);
			//TODO file:///C:/Users/dell/Desktop/System/vmspec/ConstantPool.doc.html#86899
			//TODO file:///C:/Users/dell/Desktop/System/vmspec/Instructions2.doc6.html#invokevirtual
		}
		if (idx < 1 || idx >= current_parse_result.constant_pool_count) throw "NoSuchMethodError";
		if (current_parse_result.constant_pool[idx].tag != 10) throw "NoSuchMethodError";
		
		var c_pool = current_parse_result.constant_pool;
		var class_name = c_pool[c_pool[c_pool[idx].class_index].name_index].actual_string;
		var method_name = c_pool[c_pool[c_pool[idx].name_and_type_index].name_index].actual_string;

		var type_name = c_pool[c_pool[c_pool[idx].name_and_type_index].descriptor_index].actual_string;
		
		return tryResolveAndGetMethodFrame(class_name, method_name);
	}
	
	this.operations = new Array();

	this.operations[0] = function nop() {};
	//Not sure about [1], how to push a null into a stack
	this.operations[1] = function aconst_null() { 
		tmpNull = null;
		current_frame.operand_stack.push(tmpNull);
	}

	this.operations[2] = function iconst_m1() { 
		current_frame.pushOperandStack(INT,-1); 
	};
	this.operations[3] = function iconst_0() { 
		current_frame.pushOperandStack(INT,0); 
	};
	this.operations[4] = function iconst_1() { 
		current_frame.pushOperandStack(INT,1); 
		alert("iconst_1:!!!");
		current_frame.showOperandStack();
	};
	this.operations[5] = function iconst_2() { 
		current_frame.pushOperandStack(INT,2); 
	};
	this.operations[6] = function iconst_3() { 
		current_frame.pushOperandStack(INT,3); 
		alert("iconst_3:");
		current_frame.showOperandStack();
	};
	this.operations[7] = function iconst_4() { 
		current_frame.pushOperandStack(INT,4); 
	};
	this.operations[8] = function iconst_5() { 
		current_frame.pushOperandStack(INT,5); 
	};

	this.operations[9] = function lconst_0() {  
		current_frame.pushOperandStack(LONG,0);
	};
	this.operations[10] = function lconst_1() {
		current_frame.pushOperandStack(LONG,1); 
	};

	this.operations[11] = function fconst_0() {
	current_frame.pushOperandStack(FLOAT,0.0); };
	this.operations[12] = function fconst_1() { 
	current_frame.pushOperandStack(FLOAT,1.0); };
	this.operations[13] = function fconst_2() { 
	current_frame.pushOperandStack(FLOAT,2.0); };

	this.operations[14] = function dconst_0() { 
	current_frame.pushOperandStack(DOUBLE,0.0); };
	this.operations[15] = function dconst_1() { 
	current_frame.pushOperandStack(DOUBLE,1.0); };

	this.operations[16] = function bipush() { 
		current_frame.pc++;
		tmpByte = current_frame.code[current_frame.pc];
		current_frame.pushOperandStack(BYTE,tmpByte); 
	};

	this.operations[17] = function sipush() { 
		current_frame.pc++;
		tmpShort = current_frame.code[current_frame.pc];
		current_frame.pushOperandStack(SHORT,tmpShort); 
	};

	//Question: whether it is attributes[0], need it call other method to determine the index
	this.operations[18] = function ldc() {
		if (debugMode == 1) alert("ldc");
		current_frame.pc++;
		var index = current_frame.code[current_frame.pc];
		//file:///C:/Users/dell/Desktop/System/vmspec/Instructions2.doc8.html#ldc
		var c_pool = current_parse_result.constant_pool;
		switch (c_pool[index].tag) {
			case 3:
				//TODO!!
				break;
			case 4:
				//TODO!!
				break;
			case 8:
				current_frame.operand_stack.push(new tryCreateOperand("string", c_pool[c_pool[index].string_index].actual_string));
				break;
			default:
				throw "NoSuchFieldError";
				break;
		}
	 };
	this.operations[19] = function ldc_w() {
		current_frame.pc++;
		index1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		index2 = current_frame.code[current_frame.pc];
		index = (index1 << 8) | index2;
		stringIndex = mainclass.constant_pool[index].string_index;
		returnString = getStringFromConstantId(stringIndex);
		current_frame.operand_stack.push(returnString);
	 };

	this.operations[20] = function ldc2_w() { 
	//	if(debugMode == 1) {
	//		alertOutput = "local variables before ldc2_w:\n";
	//		for(i = 0; i < current_frame.local_variables.length; i++) {
	//			alertOutput += current_frame.local_variables[i].value + "; ";
	//		}
	//		alert(alertOutput);
	//	}
		current_frame.pc++;
		index1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		index2 = current_frame.code[current_frame.pc];
		index = (index1 << 8) | index2;
		numHighByte = mainclass.constant_pool[index].high_bytes;
		numLowByte = mainclass.constant_pool[index].low_bytes;
		if(mainclass.constant_pool[index].tag == 5) { //long's tag is 5
			tmpNum = (numHighByte << 32) | numLowByte;
			tmpNum = IEEE2long(tmpNum);
			num = new valueObject(LONG,tmpNum);
			//alert(tmpNum);
		} else if(mainclass.constant_pool[index].tag == 6) {//double
			tmpNum = (numHighByte << 32) | numLowByte; //long number now
			tmpNum = IEEE2double(longNum);
			num = new valueObject(FLOAT,tmpNum);
		}
		current_frame.operand_stack.push(num);
		if(debugMode == 1) {
			alertOutput = "ldc2_w: index:"+index +"\n" +num+"\n" +"operand_stack: ";
			for(i = 0; i < current_frame.operand_stack.length; i++) {
				alertOutput += current_frame.operand_stack[i].value + "; ";
			}
			alert(alertOutput);
		}
	};


	this.operations[21] = function iload() { 
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.pushOperandStack(INT,current_frame.local_variables[index]); 
	};

	this.operations[22] = function lload() {  
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.pushOperandStack(LONG,current_frame.local_variables[index]);
	};

	this.operations[23] = function fload() { 

		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.pushOperandStack(FLOAT,current_frame.local_variables[index]);
	};
	this.operations[24] = function dload() { 
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.pushOperandStack(DOUBLE,current_frame.local_variables[index]);
	};
	this.operations[25] = function aload() { 
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.operand_stack.push(current_frame.local_variables[index])
	};

	this.operations[26] = function iload_0() { 
		alert("iload_0:"+current_frame.local_variables[0].value);
		current_frame.pushOperandStack(INT,current_frame.local_variables[0]); }
	this.operations[27] = function iload_1() { 
		current_frame.pushOperandStack(INT,current_frame.local_variables[1]); }
	this.operations[28] = function iload_2() { 
		current_frame.pushOperandStack(INT,current_frame.local_variables[2]); }
	this.operations[29] = function iload_3() { 
		current_frame.pushOperandStack(INT,current_frame.local_variables[3]); }
	this.operations[30] = function lload_0() { 
		if(debugMode == 1) {	
			alert("!!!lload_0:"+current_frame.local_variables[0].value+":::"+typeof(current_frame.local_variables[0]));
		}
		current_frame.pushOperandStack(LONG,current_frame.local_variables[0]); 
		if(debugMode == 2) {
			//alert("local 0: " + current_frame.local_variables[0].value);
			//alert(current_frame.operand_stack.length);
			//alert(current_frame.operand_stack[0].value);
		}
	}
	this.operations[31] = function lload_1() { 
		current_frame.pushOperandStack(LONG,current_frame.local_variables[1]); }
	this.operations[32] = function lload_2() { 
		current_frame.pushOperandStack(LONG,current_frame.local_variables[2]); 
	}
	this.operations[33] = function lload_3() { 
		current_frame.pushOperandStack(LONG,current_frame.local_variables[3]); }
	this.operations[34] = function float_0() { 
		current_frame.pushOperandStack(FLOAT,current_frame.local_variables[0]); }
	this.operations[35] = function float_1() { 
		current_frame.pushOperandStack(FLOAT,current_frame.local_variables[1]); }
	this.operations[36] = function float_2() { 
		current_frame.pushOperandStack(FLOAT,current_frame.local_variables[2]); }
	this.operations[37] = function float_3() { 
		current_frame.pushOperandStack(FLOAT,current_frame.local_variables[3]); }
	this.operations[38] = function dload_0() { 
		current_frame.pushOperandStack(DOUBLE,current_frame.local_variables[0]); }
	this.operations[39] = function dload_1() { 

		current_frame.pushOperandStack(DOUBLE,current_frame.local_variables[1]); }
	this.operations[40] = function dload_2() { 
		current_frame.pushOperandStack(DOUBLE,current_frame.local_variables[2]); }
	this.operations[41] = function dload_3() { 
		current_frame.pushOperandStack(DOUBLE,current_frame.local_variables[3]); }
	this.operations[42] = function aload_0() { 
		current_frame.operand_stack.push(current_frame.local_variables[0]); }
	this.operations[43] = function aload_1() { 
		current_frame.operand_stack.push(current_frame.local_variables[1]); }
	this.operations[44] = function aload_2() { 
		current_frame.operand_stack.push(current_frame.local_variables[2]); }
	this.operations[45] = function aload_3() { 
		current_frame.operand_stack.push(current_frame.local_variables[3]); }

	this.operations[46] = function iaload() { 
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		current_frame.pushOperandStack(arrayRef.type,arrayRef.array[index]);
	}
	this.operations[47] = function laload() { 
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		current_frame.pushOperandStack(arrayRef.type,arrayRef.array[index]);
	}
	this.operations[48] = function faload() { 
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		current_frame.pushOperandStack(arrayRef.type,arrayRef.array[index]);
	}
	this.operations[49] = function daload() { 
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		current_frame.pushOperandStack(arrayRef.type,arrayRef.array[index]);
	}
	this.operations[50] = function aaload() { 
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		current_frame.pushOperandStack(arrayRef.type,arrayRef.array[index]);
	}
	this.operations[51] = function baload() {
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		current_frame.pushOperandStack(arrayRef.type,arrayRef.array[index]);
	}
	this.operations[52] = function caload() {
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		current_frame.pushOperandStack(arrayRef.type,arrayRef.array[index]);
	}
	this.operations[53] = function saload() {
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		current_frame.pushOperandStack(arrayRef.type,arrayRef.array[index]);
	}

	this.operations[54] = function istore() { 
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.local_variables[index] = current_frame.operand_stack.pop();
		if(debugMode == 1) {
			if(typeof(current_frame.local_variables[index].type) != 'undefined')
				alert(current_frame.local_variables[index].value);
			else
				alert(current_frame.local_variables[index]);
		}
	};
	this.operations[55] = function lstore() { 
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.local_variables[index] = current_frame.operand_stack.pop();
		if(debugMode == 1) {
			if(typeof(current_frame.local_variables[index].type) != 'undefined')
				alert(current_frame.local_variables[index].value);
			else
				alert(current_frame.local_variables[index]);
		}
	};
	this.operations[56] = function dstore() { 
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.local_variables[index] = current_frame.operand_stack.pop();
	};
	this.operations[56] = function fstore() { 
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.local_variables[index] = current_frame.operand_stack.pop();
	};
	this.operations[57] = function astore() { 
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.local_variables[index] = current_frame.operand_stack.pop();
	};

	this.operations[59] = function istore_0() { 
		current_frame.local_variables[0] = current_frame.operand_stack.pop();
		alert("istore_0");// + current_frame.local_variables[0].value);
	};
	this.operations[60] = function istore_1() { 
		current_frame.local_variables[1] = current_frame.operand_stack.pop();};
	this.operations[61] = function istore_2() { 
		current_frame.local_variables[2] = current_frame.operand_stack.pop();};
	this.operations[62] = function istore_3() { 
		current_frame.local_variables[3] = current_frame.operand_stack.pop();};
	this.operations[63] = function lstore_0() { 
		current_frame.local_variables[0] = current_frame.operand_stack.pop();
		if(debugMode == 1)	
			alert("lstore_0:"+current_frame.local_variables[0].value);
	};
	this.operations[64] = function lstore_1() { 
		current_frame.local_variables[1] = current_frame.operand_stack.pop();};
	this.operations[65] = function lstore_2() { 
		current_frame.local_variables[2] = current_frame.operand_stack.pop();
		if(debugMode == 1)	
			alert("lstore_2:"+current_frame.local_variables[2].value);
	}
	this.operations[66] = function lstore_3() { 
		current_frame.local_variables[3] = current_frame.operand_stack.pop();};
	this.operations[67] = function fstore_0() { 
		current_frame.local_variables[0] = current_frame.operand_stack.pop();};
	this.operations[68] = function fstore_1() { 
		current_frame.local_variables[1] = current_frame.operand_stack.pop();};
	this.operations[69] = function fstore_2() { 
		current_frame.local_variables[2] = current_frame.operand_stack.pop();};
	this.operations[70] = function fstore_3() { 
		current_frame.local_variables[3] = current_frame.operand_stack.pop();};
	this.operations[71] = function dstore_0() { 
		current_frame.local_variables[0] = current_frame.operand_stack.pop();};
	this.operations[72] = function dstore_1() { 
		current_frame.local_variables[1] = current_frame.operand_stack.pop();};
	this.operations[73] = function dstore_2() { 
		current_frame.local_variables[2] = current_frame.operand_stack.pop();};
	this.operations[74] = function dstore_3() { 
		current_frame.local_variables[3] = current_frame.operand_stack.pop();};
	this.operations[75] = function astore_0() { 
		current_frame.local_variables[0] = current_frame.operand_stack.pop();};
	this.operations[76] = function astore_1() { 
		current_frame.local_variables[1] = current_frame.operand_stack.pop();};
	this.operations[77] = function astore_2() { 
		current_frame.local_variables[2] = current_frame.operand_stack.pop();};
	this.operations[78] = function astore_3() { 
		current_frame.local_variables[3] = current_frame.operand_stack.pop();};

	this.operations[79] = function iastore() { 
		value = current_frame.operand_stack.pop();
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		arrayRef[index] = value;
	}
	this.operations[80] = function lastore() { 
		value = current_frame.operand_stack.pop();
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		arrayRef[index] = value;
	}
	this.operations[81] = function fastore() { 
		value = current_frame.operand_stack.pop();
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		arrayRef[index] = value;
	}
	this.operations[82] = function dastore() { 
		value = current_frame.operand_stack.pop();
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		arrayRef[index] = value;
	}
	this.operations[83] = function aastore() { 
		value = current_frame.operand_stack.pop();
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		arrayRef[index] = value;
	}
	this.operations[84] = function bastore() { 
		value = current_frame.operand_stack.pop();
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		arrayRef[index] = value;
	}
	this.operations[85] = function castore() { 
		value = current_frame.operand_stack.pop();
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		arrayRef[index] = value;
	}
	this.operations[86] = function sastore() { 
		value = current_frame.operand_stack.pop();
		index = current_frame.popOperandStack();
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw null arrayRef
		}
		if(index > arrayRef.size) {
			//exception, throw index > array size
		}
		arrayRef[index] = value;
	}

	this.operations[87] = function pop() { 
		current_frame.operand_stack.pop();
	}

	//if it is LONG or DOUBLE, just pop one time
	this.operations[88] = function pop2() {
		if(typeof(current_frame.operand_stack[current_frame.operand_stack[length-1]].type)!='undefined' && (current_frame.operand_stack[current_frame.operand_stack[length-1]].type == LONG || current_frame.operand_stack[current_frame.operand_stack[length-1]].type == DOUBLE)) {

			current_frame.operand_stack.pop();
		} else {
			current_frame.operand_stack.pop();
			current_frame.operand_stack.pop();
		}
	}

	this.operations[89] = function dup() {
		value = current_frame.operand_stack.pop();
		current_frame.operand_stack.push(value);
		current_frame.operand_stack.push(value);
	}
	this.operations[90] = function dup_x1() {
		value1 = current_frame.operand_stack.pop();
		value2 = current_frame.operand_stack.pop();
		current_frame.operand_stack.push(value1);
		current_frame.operand_stack.push(value2);
		current_frame.operand_stack.push(value1);
	}
	this.operations[91] = function dup_x2() {
		value1 = current_frame.operand_stack.pop();
		value2 = current_frame.operand_stack.pop();
		value3 = current_frame.operand_stack.pop();
		current_frame.operand_stack.push(value1);
		current_frame.operand_stack.push(value3);
		current_frame.operand_stack.push(value2);
		current_frame.operand_stack.push(value1);
	}
	this.operations[92] = function dup2() {
		if(typeof(current_frame.operand_stack[current_frame.operand_stack[length-1]].type)!='undefined' && (current_frame.operand_stack[current_frame.operand_stack[length-1]].type == LONG || current_frame.operand_stack[current_frame.operand_stack[length-1]].type == DOUBLE)) {
			value = current_frame.operand_stack.pop();
			current_frame.operand_stack.push(value);
			current_frame.operand_stack.push(value);
		} else {
			value1 = current_frame.operand_stack.pop();
			value2 = current_frame.operand_stack.pop();
			current_frame.operand_stack.push(value2);
			current_frame.operand_stack.push(value1);
			current_frame.operand_stack.push(value2);
			current_frame.operand_stack.push(value1);
		}
	}
	this.operations[93] = function dup2_x1() {
		if(typeof(current_frame.operand_stack[current_frame.operand_stack[length-1]].type)!='undefined' && (current_frame.operand_stack[current_frame.operand_stack[length-1]].type == LONG || current_frame.operand_stack[current_frame.operand_stack[length-1]].type == DOUBLE)) {
			value = current_frame.operand_stack.pop();
			value3 = current_frame.operand_stack.pop();
			current_frame.operand_stack.push(value);
			current_frame.operand_stack.push(value3);
			current_frame.operand_stack.push(value);
		} else {
			value1 = current_frame.operand_stack.pop();
			value2 = current_frame.operand_stack.pop();
			value3 = current_frame.operand_stack.pop();
			current_frame.operand_stack.push(value2);
			current_frame.operand_stack.push(value1);
			current_frame.operand_stack.push(value3);
			current_frame.operand_stack.push(value2);
			current_frame.operand_stack.push(value1);
		}
	}
	//perhaps wrong here, I did not judge the whole cases
	//possible bugs here
	this.operations[94] = function dup2_x2() {
		if(typeof(current_frame.operand_stack[current_frame.operand_stack[length-1]].type)!='undefined' && (current_frame.operand_stack[current_frame.operand_stack[length-1]].type == LONG || current_frame.operand_stack[current_frame.operand_stack[length-1]].type == DOUBLE)) {
			value1 = current_frame.operand_stack.pop();
			value2 = current_frame.operand_stack.pop();;
			current_frame.operand_stack.push(value1);
			current_frame.operand_stack.push(value2);
			current_frame.operand_stack.push(value1);
		} else {
			value1 = current_frame.operand_stack.pop();
			value2 = current_frame.operand_stack.pop();
			value3 = current_frame.operand_stack.pop();
			value4 = current_frame.operand_stack.pop();
			current_frame.operand_stack.push(value2);
			current_frame.operand_stack.push(value1);
			current_frame.operand_stack.push(value4);
			current_frame.operand_stack.push(value3);
			current_frame.operand_stack.push(value2);
			current_frame.operand_stack.push(value1);
		}
	}

	//exception? no Long value??
	this.operations[95] = function swap() {
		value1 = current_frame.operand_stack.pop();
		value2 = current_frame.operand_stack.pop();
		current_frame.operand_stack.push(value2);
		current_frame.operand_stack.push(value1);
	}

	this.operations[96] = function iadd() { 
		if(debugMode == 1)
			alert("iadd:"+current_frame.operand_stack[1]+"+"+current_frame.operand_stack[0]);
		current_frame.pushOperandStack(INT,current_frame.popOperandStack()+current_frame.popOperandStack());
	};
	this.operations[97] = function ladd() { 
		if(debugMode == 1) {
			output = "ladd: " + current_frame.operand_stack[current_frame.operand_stack.length-2].value + "+" + current_frame.operand_stack[current_frame.operand_stack.length-1].value + " = ";
		}
		current_frame.pushOperandStack(LONG,current_frame.popOperandStack()+current_frame.popOperandStack());
		if(debugMode == 1) {
			output += current_frame.operand_stack[current_frame.operand_stack.length-1].value;
			alert(output);
		}
	};
	this.operations[98] = function fadd() { 
		current_frame.pushOperandStack(FLOAT,current_frame.popOperandStack()+current_frame.popOperandStack());
	};
	this.operations[99] = function dadd() { 
		current_frame.pushOperandStack(DOUBLE,current_frame.popOperandStack()+current_frame.popOperandStack());
	};

	this.operations[100] = function isub() { 
		current_frame.pushOperandStack(INT,-current_frame.popOperandStack()+current_frame.popOperandStack());
	};
	this.operations[101] = function lsub() { 
		current_frame.pushOperandStack(LONG,-current_frame.popOperandStack()+current_frame.popOperandStack());
	};
	this.operations[102] = function fsub() { 
		current_frame.operand_stack.push(-current_frame.operand_stack.pop()+current_frame.operand_stack.pop());
	};
	this.operations[103] = function dsub() { 
		current_frame.pushOperandStack(FLOAT,-current_frame.popOperandStack()+current_frame.popOperandStack());
	};

	this.operations[104] = function imul() { 
		current_frame.pushOperandStack(INT,-current_frame.popOperandStack()*current_frame.popOperandStack());
	};
	this.operations[105] = function lmul() { 
		current_frame.pushOperandStack(LONG,-current_frame.popOperandStack()+current_frame.popOperandStack());
	};
	this.operations[106] = function dmul() { 
		current_frame.pushOperandStack(DOUBLE,-current_frame.popOperandStack()+current_frame.popOperandStack());
	};
	this.operations[107] = function fmul() { 
		current_frame.pushOperandStack(FLOAT,-current_frame.popOperandStack()+current_frame.popOperandStack());
	};

	this.operations[108] = function idiv() { 
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		current_frame.pushOperandStack(INT,Math.floor(value1/value2));
	};
	this.operations[109] = function ldiv() { 
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		current_frame.pushOperandStack(LONG,Math.floor(value1/value2));
	};
	this.operations[110] = function fdiv() { 
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		current_frame.pushOperandStack(FLOAT,Math.floor(value1/value2));
	};
	this.operations[111] = function ddiv() { 
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		current_frame.pushOperandStack(DOUBLE,Math.floor(value1/value2));
	};

	this.operations[112] = function irem() { 
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		current_frame.pushOperandStack(INT,value1-Math.floor(value1/value2) * value2);
	};
	this.operations[113] = function lrem() { 
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		current_frame.pushOperandStack(LONG,value1-Math.floor(value1/value2) * value2);
	};
	//***todo, I do not know how to represent infinity number in JS
	//so here I did not include the case where the dividend and dividor wil be infinity number
	this.operations[114] = function frem() { 
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 == NaN || value2 == NaN) {
			current_frame.operand_stack.push(NaN);
		} else if(value2 == 0) {
			current_frame.operand_stack.push(NaN);
		} else if(value1 == 0) {
			current_frame.operand_stack.push(0);
		} else {
			if(value1 >= 0) {
				sign = 1;
			} else {
				sign = -1;
			}
			if(value1 < 0) {
				value1 = - value1;
			}
			if(value2 < 0) {
				value2 = -value2;
			}
			current_frame.pushOperandStack(FLOAT,sign*(value1-Math.floor(value1/value2) * value2));
		}
	};
	this.operations[115] = function drem() { 
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 == NaN || value2 == NaN) {
			current_frame.operand_stack.push(NaN);
		} else if(value2 == 0) {
			current_frame.operand_stack.push(NaN);
		} else if(value1 == 0) {
			current_frame.operand_stack.push(0);
		} else {
			if(value1 >= 0) {
				sign = 1;
			} else {
				sign = -1;
			}
			if(value1 < 0) {
				value1 = - value1;
			}
			if(value2 < 0) {
				value2 = -value2;
			}
			current_frame.pushOperandStack(DOUBLE,sign*(value1-Math.floor(value1/value2) * value2));
		}
	};
	this.operations[116] = function ineg() {
		current_frame.pushOperandStack(INT,-current_frame.popOperandStack());
	}
	this.operations[117] = function lneg() {
		current_frame.pushOperandStack(LONG,-current_frame.popOperandStack());
	}
	this.operations[118] = function fneg() {
		current_frame.pushOperandStack(FLOAT,-current_frame.popOperandStack());
	}
	this.operations[119] = function dneg() {
		current_frame.pushOperandStack(DOUBLE,-current_frame.popOperandStack());
	}

	this.operations[120] = function ishl() {
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		s = value2 & 31; //get the lowest five bits
		current_frame.pushOperandStack(INT,value1 <<= s);
	}
	this.operations[121] = function lshl() {
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		s = value2 & 63; //get the lowest six bits
		current_frame.pushOperandStack(LONG,value1 <<= s);
	}
	this.operations[122] = function ishr() {
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		s = value2 & 31; //get the lowest five bits
		current_frame.pushOperandStack(INT,value1 >>= s);
	}
	this.operations[123] = function lshr() {
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		s = value2 & 63; //get the lowest six bits
		current_frame.pushOperandStack(LONG,value1 >>= s);
	}
	//possible bugs in shift
	this.operations[124] = function iushr() {
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		s = value2 & 0x1f; //get the lowest five bits
		if(value1 >= 0) {
			value1 >>= s;
		} else {
			value1 = (value1 >> s) + (2 << ~s);
		}
		current_frame.pushOperandStack(INT,value1);
	}
	this.operations[125] = function lushr() {
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		s = value2 & 0x3f; //get the lowest five bits
		if(value1 >= 0) {
			value1 >>= s;
		} else {
			value1 = (value1 >> s) + (2 << ~s);
		}
		current_frame.pushOperandStack(LONG,value1);
	}
	this.operations[126] = function iand() {
		current_frame.pushOperandStack(INT,current_frame.popOperandStack() & current_frame.popOperandStack());
	}
	this.operations[127] = function land() {
		current_frame.pushOperandStack(LONG,current_frame.popOperandStack() & current_frame.popOperandStack());
	}
	this.operations[128] = function ior() {
		current_frame.pushOperandStack(INT,current_frame.popOperandStack() 
	| current_frame.popOperandStack());
	}
	this.operations[129] = function lor() {
		current_frame.pushOperandStack(LONG,current_frame.popOperandStack() | current_frame.popOperandStack());
	}
	this.operations[130] = function ixor() {
		current_frame.pushOperandStack(INT,current_frame.popOperandStack() ^ current_frame.popOperandStack());
	}
	this.operations[131] = function lxor() {
		current_frame.pushOperandStack(LONG,current_frame.popOperandStack() ^ current_frame.popOperandStack());
	}
	this.operations[132] = function iinc() {
		current_frame.pc++;
		index = current_frame.code[current_frame.pc];
		current_frame.pc++;
		constValue = current_frame.code[current_frame.pc];
		if(typeof(current_frame.local_variables[index].type)!='undefined') {
			current_frame.local_variables[index].value += constValue;
		} else {
			current_frame.local_variables[index] += constValue;
		}
	}
	this.operations[133] = function i2l() {
	//IEEE 754
	}
	this.operations[134] = function i2f() {
	//IEEE 754
	}
	this.operations[135] = function i2d() {
	//IEEE 754
	}
	this.operations[136] = function l2i() {
	//IEEE 754
	}
	this.operations[137] = function l2f() {
	//IEEE 754
	}
	this.operations[138] = function l2d() {
	//IEEE 754
	}
	this.operations[139] = function f2i() {
	//IEEE 754
		num = current_frame.popOperandStack();
		if(num == NaN) {
			current_frame.pushOperandStack(INT,0);
		} else {
			current_frame.pushOperandStack(INT,Math.round(num));
		}
	}
	this.operations[140] = function f2l() {
	//IEEE 754
		num = current_frame.popOperandStack();
		if(num == NaN) {
			current_frame.pushOperandStack(LONG,0);
		} else {
			current_frame.pushOperandStack(LONG,Math.round(num));
		}
	}
	this.operations[141] = function f2d() {
	//IEEE 754
	}
	this.operations[142] = function d2i() {
	//IEEE 754
		num = current_frame.popOperandStack();
		if(num == NaN) {
			current_frame.pushOperandStack(INT,0);
		} else {
			current_frame.pushOperandStack(INT,Math.round(num));
		}
	}
	this.operations[143] = function d2l() {
	//IEEE 754
		num = current_frame.popOperandStack();
		if(num == NaN) {
			current_frame.pushOperandStack(LONG,0);
		} else {
			current_frame.pushOperandStack(LONG,Math.round(num));
		}
	}
	this.operations[144] = function d2f() {
	//IEEE 754
	}
	//what is byte?***todo
	this.operations[145] = function i2b() {
		value = current_frame.popOperandStack();
		byteValue = value & 255;
		current_frame.pushOperandStack(BYTE,byteValue)
	}
	//***todo, how to change int to char???
	this.operations[146] = function i2c() {
		value = current_frame.popOperandStack();
		charValue = value & 65535;
		current_frame.pushOperandStack(CHAR,charValue);
	}
	//***todo, how to change int to short
	this.operations[147] = function i2s() {
		value = current_frame.popOperandStack();
		shortValue = value & 65535;
		current_frame.pushOperandStack(SHORT,shortValue);
	}

	this.operations[148] = function lcmp() {
		if(debugMode == 1)	
			alert("lcmp");
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 > value2) {
			current_frame.pushOperandStack(INT,1);
		} else if(value1 == value2) {
			current_frame.pushOperandStack(INT,0);
		} else {
			current_frame.pushOperandStack(INT,-1);
		}
	}
	//***todo, value set conversion
	this.operations[149] = function fcmpl() {

		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 > value2) {;
			current_frame.pushOperandStack(INT,1);
		} else if(value1 == value2) {
			current_frame.pushOperandStack(INT,0);
		} else if(value1 < value2){
			current_frame.pushOperandStack(INT,-1);
		} else { //it is NaN in the stack
			current_frame.pushOperandStack(INT,1);
		}
	}
	//***todo
	this.operations[150] = function fcmpg() {
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 > value2) {;
			current_frame.pushOperandStack(INT,1);
		} else if(value1 == value2) {
			current_frame.pushOperandStack(INT,0);
		} else if(value1 < value2){
			current_frame.pushOperandStack(INT,-1);
		} else { //it is NaN in the stack
			current_frame.pushOperandStack(INT,-1);
		}
	}
	//***todo, value set conversion
	this.operations[151] = function dcmpl() {
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 > value2) {;
			current_frame.pushOperandStack(INT,1);
		} else if(value1 == value2) {
			current_frame.pushOperandStack(INT,0);
		} else if(value1 < value2){
			current_frame.pushOperandStack(INT,-1);
		} else { //it is NaN in the stack
			current_frame.pushOperandStack(INT,1);
		}
	}
	//***todo
	this.operations[152] = function dcmpg() {
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 > value2) {;
			current_frame.pushOperandStack(INT,1);
		} else if(value1 == value2) {
			current_frame.pushOperandStack(INT,0);
		} else if(value1 < value2){
			current_frame.pushOperandStack(INT,-1);
		} else { //it is NaN in the stack
			current_frame.pushOperandStack(INT,-1);
		}
	}

	//***todo, perhaps wrong with the exact transfer number, the following also be included
	this.operations[153] = function ifeq() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value = current_frame.popOperandStack();
		if(value == 0) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[154] = function ifne() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value = current_frame.popOperandStack();
		if(value != 0) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	 };
	this.operations[155] = function iflt() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value = current_frame.popOperandStack();
		if(value < 0) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[156] = function ifge() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value = current_frame.popOperandStack();
		if(value >= 0) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[157] = function ifgt() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value = current_frame.popOperandStack();
		if(value > 0) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[158] = function ifle() {  
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value = current_frame.popOperandStack();
		if(value <= 0) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};

	this.operations[159] = function if_icmpeq() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 == value2) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[160] = function if_icmpne() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 != value2) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[161] = function if_icmplt() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 < value2) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[162] = function if_icmpge() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 >= value2) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[163] = function if_icmpgt() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 > value2) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[164] = function if_icmple() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 <= value2) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[165] = function if_acmpeq() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 == value2) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[166] = function if_acmpne() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value2 = current_frame.popOperandStack();
		value1 = current_frame.popOperandStack();
		if(value1 != value2) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};

	//***todo, perhaps be wrong
	this.operations[167] = function goto_n() { //goto
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;

		current_frame.pc = current_frame.pc + branchbyte;
	}

	//*****todo unfinished yet, do not know how to implement it
	this.operations[168] = function jsr() { }
	this.operations[169] = function ret() { }

	//***todo, unfinished yet
	this.operations[170] = function tableswitch() { 

	}
	//***todo, unfinished yet
	this.operations[171] = function lookupswitch() { 

	}

	this.operations[172] = function ireturn() { 
		if(debugMode == 2) 
			alert("ireturn");
		if(the_itpt.stack.length >= 2) {
			the_itpt.stack[the_itpt.stack.length-2].pushOperandStack(INT,current_frame.popOperandStack());
			the_itpt.stack.pop();
			current_frame = the_itpt.stack[the_itpt.stack.length-1];
			current_frame.pc = current_frame.currentPc;
			this.codelength = current_frame.method.attributes[0].code_length;
		} else {
			alert("the_itpt.stack length less than 2, 172");
			//returnValue = null;
		}
	};
	this.operations[173] = function lreturn() { 
		if(debugMode == 1) {
			alert("lreturn");
		}
		if(the_itpt.stack.length >= 2) {
			the_itpt.stack[the_itpt.stack.length-2].pushOperandStack(LONG,current_frame.popOperandStack());
			the_itpt.stack.pop();
			current_frame = the_itpt.stack[the_itpt.stack.length-1];
			current_frame.pc = current_frame.currentPc;
			this.codelength = current_frame.method.attributes[0].code_length;
			//alert(current_frame.operand_stack.length);
			//alert("lreturn:" + current_frame.operand_stack[current_frame.operand_stack.length-1].value);
		} else {
			alert("the_itpt.stack length less than 2, 173");
			//returnValue = null;
		}
	};
	this.operations[174] = function freturn() { 
		if(the_itpt.stack.length >= 2) {
			the_itpt.stack[the_itpt.stack.length-2].pushOperandStack(FLOAT,current_frame.popOperandStack());
			the_itpt.stack.pop();
			current_frame = the_itpt.stack[the_itpt.stack.length-1];
			current_frame.pc = current_frame.currentPc;
			this.codelength = current_frame.method.attributes[0].code_length;
		} else {
			alert("the_itpt.stack length less than 2, 174");
			//returnValue = null;
		}
	};
	this.operations[175] = function dreturn() { 
		if(the_itpt.stack.length >= 2) {
			the_itpt.stack[the_itpt.stack.length-2].pushOperandStack(DOUBLE,current_frame.popOperandStack());
			the_itpt.stack.pop();
			current_frame = the_itpt.stack[the_itpt.stack.length-1];
			current_frame.pc = current_frame.currentPc;
			this.codelength = current_frame.method.attributes[0].code_length;
		} else {
			alert("the_itpt.stack length less than 2, 175");
			//returnValue = null;
		}
	};
	this.operations[176] = function areturn() { 
		if(the_itpt.stack.length >= 2) {
			the_itpt.stack[the_itpt.stack.length-2].pushOperandStack(REFERENCE,current_frame.popOperandStack());
			the_itpt.stack.pop();
			current_frame = the_itpt.stack[the_itpt.stack.length-1];
			current_frame.pc = current_frame.currentPc;
			this.codelength = current_frame.method.attributes[0].code_length;
		} else {
			alert("the_itpt.stack length less than 2, 176");
			//returnValue = null;
		}
	};

	this.operations[177] = function returnNull() { 
		/*
		if (the_itpt.stack.length >= 2) {

			the_itpt.stack.pop();
			current_frame = the_itpt.stack[the_itpt.stack.length-1];
			current_frame.pc = current_frame.currentPc;

		} else {
			alert("the_itpt.stack length less than 2, 177");
		//alert("return");

		}
		*/
	};

	//unfinished, need to do more
	//TODO!!
	this.operations[178] = function getstatic() {
		//alert(current_frame);
		if (debugMode == 1) 
			alert("getstatic");
		++current_frame.pc;
		var indexbyte1 = current_frame.code[current_frame.pc];
		++current_frame.pc;
		var indexbyte2 = current_frame.code[current_frame.pc];
		var index = (indexbyte1 << 8) | indexbyte2;

		//resolve
		var value = tryGetField(index);
				
		current_frame.operand_stack.push(value);
		/*
		if (mainclass.constant_pool[index].tag == 20) { //this number means it has been visited before

			current_frame.operand_stack.push(mainclass.constant_pool[index].content);
		} else {

		}*/
	};

	this.operations[179] = function putstatic() { 
		if(debugMode == 1) 
			alert("putstatic");
		current_frame.pc++;
		indexbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		indexbyte2 = current_frame.code[current_frame.pc];
		index = (indexbyte1 << 8) | indexbyte2;
		mainclass.constant_pool[index].tag = 20; //this number means it has been analyzed
		mainclass.constant_pool[index].content = current_frame.operand_stack.pop();
	};

	//***unfinished yet
	this.operations[180] = function getfield() { 
	};
	this.operations[181] = function putfield() { 
	};
	//fake native methods, just for demo
	this.operations[182] = function invokevirtual() { 
		if(debugMode == 1)
			alert("invokevirtual");
		current_frame.pc++;
		var indexbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		var indexbyte2 = current_frame.code[current_frame.pc];
		var index = (indexbyte1 << 8) | indexbyte2;
		
		//file:///C:/Users/dell/Desktop/System/vmspec/Instructions2.doc6.html#invokevirtual
		var frame = tryGetMethodFrame(index);
		if (frame.class_name == "java/io/PrintStream" && frame.method_name == "println") {
			alert("println: " + current_frame.operand_stack.pop().value);
			return;
		}
		if (debugMode == 1) 
			alert("class: " + frame.class_name + "; method: " + frame.method_name);
		the_itpt.stack.push(frame);
		
		/*
		nameTypeIndex = mainclass.constant_pool[index].name_and_type_index;
		nameIndex = mainclass.constant_pool[nameTypeIndex].name_index;
		typeIndex = mainclass.constant_pool[nameTypeIndex].descriptor_index;

		if(getStringFromConstantId(nameIndex) == "println") {
			alert(current_frame.popOperandStack());
		}

		*/
	};

	//***unfinished yet
	this.operations[183] = function invokespecial() { 
	};


	this.operations[184] = function invokestatic() { 
		if(debugMode == 1)
			alert("invokestatic");
		current_frame.pc++;
		indexbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		indexbyte2 = current_frame.code[current_frame.pc];
		index = (indexbyte1 << 8) | indexbyte2;
		//current_frame.currentPc = current_frame.pc; //memorize the next current_frame.pc position
		if(debugMode == 1)
			alert("currentPc:"+current_frame.currentPc);

		var classIndex = current_class.constant_pool[nameTypeIndex].class_index;
		var methodNameTypeIndex = current_class.constant_pool[index].name_and_type_index;
		var classNameIndex = current_class.constant_pool[classIndex].name_index;
		var className = current_class.constant_pool[classIndex].bytes;

		//nextClass is the class this method belongs to.
		var nextClass = tryLoadAndLinkClass(className);
		var methodNameIndex = current_class.constant_pool[nameTypeIndex].name_index;
		var methodTypeIndex = current_class.constant_pool[nameTypeIndex].methodTypeIndex;
		var methodName = current_class.constant_pool[methodNameIndex].bytes;
		var methodType = current_class.constant_pool[methodTypeIndex].bytes;

		nextMethod = findMethodFromClass(methodName,nextClass);

		//unfinished
		nextFrame = new tryCreateFrame(nextClass,nextMethod,"");

		//ignore the class part, we have only mainclass here.

		if(debugMode == 1)
			alert("method");

		//inputNum = findDescriptorInputNum(descriptor_index);
		inputLen = getMethodTypeLen(methodType);
		//There is another way to do this ***
		//alert("inputNum: " + inputNum);
		//alert("inputLen: " + inputLen);
		//alert("operand_stack:" + current_frame.operand_stack.toString());
		for(i = inputLen-1; i >= 0; i--) {
			value = current_frame.operand_stack.pop();
			//alert(value.tag);
			if(typeof(value.type)!='undefined') {
				if(value.type == DOUBLE || value.type == LONG) {
					i--;
					nextFrame.local_variables[i] = value;
				} else {
					nextFrame.local_variables[i] = value;
				}
			} else {
				nextFrame.local_variables[i] = value;
			}
		}
		
		the_itpt.stack.push(nextFrame);

	};

	//***unfinished yet
	this.operations[185] = function invokeinterface() { 
	};
	this.operations[187] = function newobj() { 
	};

	this.operations[188] = function newarray() {
		size = current_frame.popOperandStack();
		if(size < 0) {
			//throw: negative array size;
		}
		current_frame.pc++;
		var type;
		typeNum = current_frame.code[current_frame.pc];
		switch(typeNum) {

			case 4: type = BOOLEAN; break;
			case 5: type = CHAR; break;
			case 6: type = FLOAT; break;
			case 7: type = DOUBLE; break;
			case 8: type = BYTE; break;
			case 9: type = SHORT; break;
			case 10: type = INT; break;
			case 11: type = LONG; break;
			default: alert("not existed type");
		}
		//create a new array
		//****not sure about this method
		var arrayObject = new ArrayObject(type,size);
		current_frame.operand_stack.push(arrayObject);
	}

	//***unfinished yet
	this.operations[189] = function anewarray() {}

	this.operations[190] = function arraylength() {
		arrayRef = current_frame.popOperandStack();
		if(arrayRef == null) {
			//exception, throw NullPointerException	
		} else {
			current_frame.pushOperandStack(INT,arrayRef.size);
		}
	}

	//***unfinished yet
	this.operations[191] = function athrow() {

	}

	//***unfinished yet
	this.operations[192] = function checkcast() {

	}
	this.operations[193] = function instanceof_op() {;};
	this.operations[194] = function monitorenter() {;};
	this.operations[195] = function monitorexit() {;};
	this.operations[196] = function wide() {;};
	this.operations[197] = function multianewarray() {;};

	this.operations[198] = function ifnull() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value = current_frame.popOperandStack();
		if(value == null) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};
	this.operations[199] = function ifnonnull() { 
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		branchbyte = branchbyte1 << 8 | branchbyte2;
		value = current_frame.popOperandStack();
		if(value != null) {
			current_frame.pc = current_frame.pc + branchbyte;
		}
	};

	this.operations[200] = function goto_w() {
		current_frame.pc++;
		branchbyte1 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte2 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte3 = current_frame.code[current_frame.pc];
		current_frame.pc++;
		branchbyte4 = current_frame.code[current_frame.pc];
		branchbyte = (branchbyte1 << 24) | (branchbyte2 << 16) | (branchbyte3 << 8) | branchbyte4;

		current_frame.pc = current_frame.pc + branchbyte;
	};

	this.operations[201] = function jsr_w() {
	};


//---------------------------------------------


	getMethodTypeLen = function(methodType) {
		var num = 0;
		var i;
		for(i = 0; i < methodType.length; i++) {
			tmpChar = String.fromCharCode(methodType[i]);
			if(tmpChar == '(')
				break;
		}
		for(; i < methodType.length; i++) {
			tmpChar = String.fromCharCode(methodType[i]);
			if(tmpChar != ')') { //41 == ')'
				if(tmpChar == 'B' || tmpChar == 'C' || tmpChar == 'F' || tmpChar == 'I' || tmpChar == 'S' || tmpChar == 'Z')
					num++;
				else if(tmpChar == 'D' || tmpChar == 'J')
					num+=2;
			} else {
				return num;
			}
		}
	}

	//get the strings from constant pool
	getStringFromConstantId = function(id) {
		stringValue = "";
		for(everyChar in mainclass.constant_pool[id].bytes) {
			charValue = String.fromCharCode(mainclass.constant_pool[id].bytes	[everyChar]);
			stringValue += charValue;
		}
			//alert(stringValue);
		return stringValue;
	}

	findMethodFromClass = function(methodName,methodClass) {
		for(var currentMethod in methodClass.methods) {
			var currentMethodNameIndex = currentMethod.name_index;
			var currentMethodName = methodClass.constant_pool[methodNameIndex].bytes;
			if(currentMethodName == methodName) {
				return currentMethod;
			}
		}
	}
}
